package com.zjzywl.smoke.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.zjzywl.smoke.entity.SysUser;

@Repository
public interface SysUserRepository extends JpaRepository<SysUser,Integer> ,SysUserCustomRepository{
	@Query("select u from SysUser u where loginName=:loginName and password=:password")
	SysUser findByLoginNameAndPassword(@Param("loginName") String loginName,@Param("password") String password);
	
	@Query("select u from SysUser u where loginName=:loginName")
	SysUser findByLoginName(@Param("loginName") String loginName);
	
	@Query("select u.telephone ,u.name from SysUser u where loginName=:loginName")
	List<String> findUser(@Param("loginName") String loginName);
	
	@Query("select u from SysUser u where userType=:userType")	
	List<SysUser> findByUserType(@Param("userType") Integer userType);
	
	List<SysUser> findByUserTypeNot(Integer userType);

	




}
